const Sequelize = require('sequelize');
const baseModel = require('../baseModel');

class notifyModel extends baseModel{
  constructor(){
    super('notify',{
      id:{
        type: Sequelize.INTEGER,
        autoIncrement: true,
        allowNull: false,
        primaryKey:true
      },
      title:{
        type: Sequelize.STRING(20),
        allowNull: true,
      },
      org:{
        type: Sequelize.INTEGER,
        allowNull: false,
      },
      content:{
        type: Sequelize.STRING(50),
        allowNull: true,
      },
      author:{
        type: Sequelize.STRING(16),
        allowNull: false
      },
      link:{
        type: Sequelize.STRING,
        allowNull: true
      },
      startTime: {
        type: Sequelize.DATE,
        allowNull: false
      },
      endTime:{
        type: Sequelize.DATE,
        allowNull: false
      },
      updatedAt: {
        type: Sequelize.DATE,
        allowNull: false
      },
      createdAt: {
        type: Sequelize.DATE,
        allowNull: false
      }
    });
    this.model = super.getModel();
    this.model.sync();
  }
}

module.exports = new notifyModel();
